<?php
require_once('smarty/SmartyInclude.php');
require_once('com/fabriciojf/persistence/ConfigDAO.class.php');
require_once('com/fabriciojf/include/Config.class.php');

// instancia um objeto smarty padrão
$smarty = SmartyInclude::getSmarty();
require_once('com/fabriciojf/include/Menu.class.php');

$configDao = new ConfigDAO();
if ($configDao->getRegistro('habilitarconta')->getValor() == 'true') {
    $criarconta = '<a href="do.php?action=UserCreate">Criar uma Conta</a>';
} else {
    $criarconta = '';
}

$menuon = Menu::getMenuOn();
$menuPost = Menu::getMenuPost();
$menuPage = Menu::getMenuPages();

// carrega o template
$smarty->assign('menuon', $menuon);
$smarty->assign('menupost', $menuPost);
$smarty->assign('menupage', $menuPage);

$smarty->assign('tituloSite', Configuracao::getAtributo('titulo'));

$smarty->assign('criarconta', $criarconta);

// carrega o template
$smarty->display('login.tpl');

?>
